package com.diy.sigmund.controller;

import com.diy.sigmund.util.AutoTestMapperUtil;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ylm-sigmund
 * @since 2023/5/19 10:56
 */
@RestController
public class AutoTestMapperUtilController {

    @Autowired
    SqlSessionFactory sqlSessionFactory;

    @GetMapping("/execute/autoTestMapper")
    public String execute() throws Exception {
        // AutoTestMapperUtil autoTestMapperUtil = new AutoTestMapperUtil("存放Mapper全路径名");
        AutoTestMapperUtil autoTestMapperUtil = new AutoTestMapperUtil("D:\\code\\spring-cloud\\nacos-parent\\nacos-spring-cloud-discovery-config-example\\async-transactional\\src\\main\\java\\com\\diy\\sigmund\\mapper");
        autoTestMapperUtil.openSqlSession(sqlSessionFactory);
        return "success";
    }
}
